<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<style>
    /* a:link{
        background-color: black;
        color: white;
    }
    a:visited{
        background-color: black;
        color: white;
    }
    a:hover{
        background-color: red;
    }
    a:active{
        background-color: red;
    } */

    a{
        background-color: black;
        color:white;
        text-decoration:none;    /*取消文字下划线*/
        display: inline-block;   /*转换为行内块元素*/
        padding: 10px;           /*设置内边距10px*/
    }
    a:hover{
        background-color: red;
    }
    .home{
        background-color: red;
    }
</style>

</head>
<body>
    <a href="" class="home">首页</a>
    <a href="">国内</a>
    <a href="">国际</a>
    <a href="">军事</a>
    <a href="">财经</a>
    <div>1111111111111111</div>
</body>
</html>